<template>
	<view>
		<view class="cardShadow u-margin-bottom-20" style="padding-bottom:10rpx ;">
			<template>			
				<view class="title">
					{{ item[$t('item.goods_name')] || $t("暂无信息") }}
				</view>
				
				<view class="lineP">
					<view style="flex: 1;">
						<view class="lineP">
							<Tag class="u-margin-bottom-14" :text="item[$t('item.goods_weight')]+'kg'" color="#008aff">
							</Tag>
							<Tag class="u-margin-bottom-14" :text="item[$t('item.goods_volume')]+'m³'" color="#ff7200">
							</Tag>
							<Tag class="u-margin-bottom-14" :text="item[$t('item.goods_num')]+item[$t('item.number_unit')]" color="#18d62a"></Tag>
							<Tag class="u-margin-bottom-14" :text="$t(item.whole_diffuse)" color="#18cee3"></Tag>
						</view>
						<view style="width: 100%;display: flex;">
							<view class="lineP u-margin-bottom-0" style="width: 70%;display: inline-block;">
								<FromToCountry :item="item"></FromToCountry>
								<view class="address">
									<view class="label">{{$t("出发城市")}}</view>
									<image :src="HTTP_IMG_UTL+'tubiao1.png'" class="headline_img" />
									<view class="u-flex-1">{{item.hyd || $t("暂无信息") }}</view>
								</view>
								<view class="address">
									<view class="label">{{$t("到达城市")}}</view>							
									<image :src="HTTP_IMG_UTL+'tubiao2.png'" class="headline_img" />
									<view class="u-flex-1">{{item.shd || $t("暂无信息") }}</view>
								</view>
								<view class="address">
									<TransportType :item="item"></TransportType>
								</view>
							</view>
							<view class="carPicture">
								<img :src="HTTP_IMG_UTL+'huowuPic.png'" alt="" />
							</view>
						</view>
					</view>
				</view>
			</template>
		</view>
		
		<view class="cardShadow">
			<view>
				<ProductWHL :item="item" :type="type"></ProductWHL>
			</view>
			<view class="u-border-bottom u-margin-bottom-20"></view>	
		</view>
		
	</view>
</template>

<script>
	import TransportType from '@/components/TransportType.vue'
	import ProductWHL from '@/components/ProductWHL.vue'
	
	import {
		createC2CConversation,
		isBase64,
		time
	} from "@/common/public";
	import FromToCountry from '@/components/FromToCountry.vue'

	import Tag from '@/components/Tag.vue'
	import {
		IMAGE_URL,
		HTTP_IMG_UTL
	} from "@/config/app";
	export default {
		components: {
			Tag,
			FromToCountry,
			TransportType,
			ProductWHL
		},
		props: {
			item: {
				type: Object,
				default: {},
			},
			type: {
				type: String,
				default: '1',
			},
		},
		computed: {
			toImages() {
				return (src) => {
					return isBase64(src) ? src : IMAGE_URL + src
				}
			},
		},
		data() {
			return {
				HTTP_IMG_UTL
			};
		},
		methods: {
			time
		}
	}
</script>

<style lang="scss" scoped>
	.carPicture {
		margin-top: 30rpx;
		img {
			height: 160rpx;
			width: 180rpx;
		}
	}

	.lineP {
		display: flex;
		align-items: center;
		margin-bottom: 8px;
		position: relative;
		font-size: 16px;
		position: relative;
		flex-wrap: wrap;

		.tag {
			margin-top: 20rpx;
		}

		&.shot {
			width: 48%;
			flex-wrap: wrap;


		}

		.headline_img {
			width: 30rpx;
			height: 30rpx;
			margin-right: 10rpx;
		}

		.label {
			font-weight: 600;
			margin-bottom: 10rpx;
			color: #ff7200;
			padding-left: 35rpx;
		}
	}

	.title {
		color: #000000;
		text-align: left;
		font-size: 38rpx;
		font-weight: 600;
		margin-top: 10rpx;
		word-break: break-all;
		margin-bottom: 10rpx;
	}
	
	.address {
		margin-top: 15rpx;
		margin-bottom: 15rpx;
		font-size: 28rpx;
		position: relative;
		padding-left: rpx;
		// font-weight: 600;
	
		// .warp {
		// 	width: 55%;
		// }
	
		.headline_img {
			position: absolute;
			left: 0;
			top: 4rpx;
			width: 30rpx;
			height: 30rpx;
		}
	
		.label {
			font-weight: 600;
			margin-bottom: 10rpx;
		}
	}
</style>